#include "FinalPosition.h"

#include "TrajSimul.h"

#include <iostream>

FinalPosition::FinalPosition(Clock clock,Output output,Pulse *field,Pulse *current,MultiLayer multiLayer,NewParameters params)
{
  MultiLayer sample=multiLayer;
  double tempI=current->getLevel(clock.getTimeStamp());
  int layerNumber=multiLayer.getSolveLayer();
  Vector3 tempMag=multiLayer[layerNumber].getMag();
  tempMag.mult(-1);
  sample[layerNumber].setMag(tempMag);
  current->setLevel(0);
  MultiLayer temp=TrajSimul().solve(clock,output,field,current,sample,params);
  clock.setTimeStamp(0);
  current->setLevel(tempI);
  x=temp[layerNumber].getMag().getX();
  y=temp[layerNumber].getMag().getY();
  z=temp[layerNumber].getMag().getZ();
}

FinalPosition::~FinalPosition()
{

}

